package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.control.qct.businesssteward.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.control.qct.businesssteward.model.GoodsDetailModel;
import com.control.qct.businesssteward.utils.GlideUtil;

import java.util.List;

/**
 * Created by Administrator on 2017/12/19 0019.
 */

public class GoodsDetailPictureAdapter extends BaseQuickAdapter<GoodsDetailModel.FileImageUrl, BaseViewHolder> {
    private boolean mIsShow;

    public GoodsDetailPictureAdapter(@Nullable List<GoodsDetailModel.FileImageUrl> data) {
        super(R.layout.rv_goods_detail_picture_information_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, GoodsDetailModel.FileImageUrl item) {
        GlideUtil.loadImage(mContext,item.getImageBigUrl(), (ImageView) holder.getView(R.id.iv_goods_picture));
        holder.setGone(R.id.iv_delete, mIsShow);
        holder.addOnClickListener(R.id.iv_delete);
    }

    public void setShow(boolean isShow) {
        this.mIsShow = isShow;
        notifyDataSetChanged();
    }
}
